package com.jprocms.module.cms.content;

import com.jprocms.module.cms.framework.enums.EnumContentEvent;
import lombok.Data;
import org.springframework.context.ApplicationEvent;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 内容创建/修改 删除 Event
 *
 * @author jprocms
 */
@SuppressWarnings("ALL")
@Data
public class ContentAppEvent extends ApplicationEvent {

    /**
     * 内容ID
     */
    @NotNull(message = "内容ID")
    private Long id;

    /**
     * 批量处理的id集合
     */
    private List<Long> ids;

    @NotNull(message = "事件类型")
    private EnumContentEvent event;

    public ContentAppEvent(Object source, Long id, EnumContentEvent event) {
        super(source);
        this.id = id;
        this.event = event;
    }

    public ContentAppEvent(Object source, List<Long> ids, EnumContentEvent event) {
        super(source);
        this.ids = ids;
        this.event = event;
    }

    public ContentAppEvent(Object source) {
        super(source);
    }

}
